﻿using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using LERP.Domain.Enums;

namespace LERP.Web.Controllers.ViewModels.UserViewModels
{
    public class UserViewModel
    {
        /// <summary>
        /// 用户id
        /// </summary> 
        public virtual int Id { get; set; }
        /// <summary>
        /// 登录名  登录名唯一
        /// </summary>  
        [Display(Name = "登录名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string UserName { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [Display(Name = "姓名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Name { get; set; }
        /// <summary>
        /// 手机号码
        /// </summary>
        [Display(Name = "手机号码")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Mobile { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        [Display(Name = "邮箱")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Email { get; set; }
        /// <summary>
        /// 员工角色
        /// </summary>
        [Display(Name = "员工角色")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual int Role { get; set; }
         
    }


    public class ResetPasswordViewModel
    {
        /// <summary>
        /// 登录名  登录名唯一
        /// </summary>  
        [Display(Name = "登录名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Display(Name = "密码")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(225, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Password { get; set; }
        /// <summary>
        /// 确认密码
        /// </summary>
        [Display(Name = "密码确认")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(225, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [Compare("Password", ErrorMessage = "两次密码输入不一致")]
        public virtual string RePassword { get; set; }
    }
    public class ChangePasswordViewModel
    { 
        /// <summary>
        /// 登录名  登录名唯一
        /// </summary>  
        [Display(Name = "登录名")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Display(Name = "原密码")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(225, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string OldPassword { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Display(Name = "新密码")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(225, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        public virtual string Password { get; set; }
        /// <summary>
        /// 确认密码
        /// </summary>
        [Display(Name = "新密码确认")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(225, ErrorMessage = "{0}不能超过{1}个字符", MinimumLength = 0)]
        [Compare("Password", ErrorMessage = "两次密码输入不一致")]
        public virtual string RePassword { get; set; }
    }
}